home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 3.6 KB | 120 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: BmpSel.h
- // Release Version: $ 1.0d1 $
- //
- // Author: Henri Lamiraux
- // Creation Date: 3/28/94
- //
- // Copyright: © 1993, 1994 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef BMPSEL_H
- #define BMPSEL_H
-
- // ----- FrameWork Includes -----
-
- #ifndef FWSELECT_H
- #include "FWSelect.h"
- #endif
-
- // ----- Graphic Includes -----
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- #ifndef FWPAT_H
- #include "FWPat.h"
- #endif
-
- //========================================================================================
- // •• Forward Declarations
- //========================================================================================
-
- class CBitmapPart;
- class CBitmapFacet;
- class FW_CGraphicContext;
-
- //========================================================================================
- // •• class CBitmapSelection
- //========================================================================================
-
- class CBitmapSelection : public FW_CSelection
- {
- //----------------------------------------------------------------------------------------
- // • Initialization/Destruction
- //
- public:
- CBitmapSelection();
- void InitBitmapSelection(CBitmapPart* thePart);
- virtual ~CBitmapSelection();
-
- //----------------------------------------------------------------------------------------
- // • Inherited API
- //
- public:
- virtual void CloseSelection();
- virtual void SelectAll();
- virtual FW_Boolean IsEmpty() const;
- virtual FW_Boolean DoClear();
-
- virtual void ExternalizeSelection(XMPStorageUnit* storageUnit, FW_CFrame* commandFrame, XMPCloneKind cloneKind);
- virtual FW_Boolean InternalizeSelection(XMPStorageUnit* storageUnit, XMPCloneKind cloneKind);
-
- virtual XMPRgnHandle CalcDragRgn(FW_CFacet* facet);
- virtual XMPShape* GetSelectionShape();
-
- //----------------------------------------------------------------------------------------
- // • New API
- //
- public:
- void GetSelectRect(FW_CRect& rect) const;
- void SetSelectRect(const FW_CRect& rect);
-
- FW_Boolean Track(CBitmapFacet* facet, const FW_CPoint& anchorPoint, XMPEventData event, FW_CRect& rect);
- FW_Boolean InSelection(const FW_CPoint& where) const;
-
- void MoveAnts();
- void DrawAnts(FW_CFrame* frame);
- void DoDrawAnts(FW_CGraphicContext* gc);
-
- private:
- void GetSelectRectWithZoomFactor(CBitmapFacet* facet, FW_CRect& selectRect);
- void InternalizePICT(XMPStorageUnit* storageUnit);
- void InternalizeBitmap(XMPStorageUnit* storageUnit);
-
- //----------------------------------------------------------------------------------------
- // • Data Members
- //
- private:
- CBitmapPart* fBitmapPart;
- FW_CRect fSelectRect;
- FW_Boolean fHasSelection;
- FW_CPattern fAntPattern;
- };
-
- //========================================================================================
- // •• Inlines
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // CBitmapSelection::GetSelectRect
- //----------------------------------------------------------------------------------------
- inline void CBitmapSelection::GetSelectRect(FW_CRect& rect) const
- {
- rect = fSelectRect;
- }
-
- //----------------------------------------------------------------------------------------
- // CBitmapSelection::SetSelectRect
- //----------------------------------------------------------------------------------------
- inline void CBitmapSelection::SetSelectRect(const FW_CRect& rect)
- {
- fSelectRect = rect;
- fHasSelection = TRUE;
- }
-
-
- #endif